.toc-container {
  width: 18%;
  position: fixed;
  top: 96px;
  right: 0;
  bottom: 32px;
  overflow-y: auto;
  overflow-x: hidden;
}

.toc-content {
  border-left: 1px solid $lightgray;
  margin-left: 8px;
}

aio-toc {
  &.embedded {
    @media (min-width: 801px) {
      display: none;
    }
  }
}

.toc-inner {

  &:not(.embedded) {
    @media (max-width: 800px) {
      border-left: 4px solid #4285f4;
      display: none;
    }
  }
}

aio-toc > div {
  font-size: 13px;
  overflow-y: visible;
  padding: 4px 0 0 10px;

  .toc-heading {
    font-weight: 500;
    margin: 0 0 16px 8px;
    padding: 0;
  }

  .toc-heading.secondary {
    padding-bottom: 0;
    position: relative;
    top: -8px;

    &:hover {
      color: $accentblue;
    }
  }

  button.toc-heading,
  button.toc-more-items {
    cursor: pointer;
    display: inline-block;
    background: 0;
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    text-align: start;

    &:focus.embedded {
      outline: none;
      background: $lightgray;
    }
  }

  button.toc-heading,
  div.toc-heading,
  ul.toc-list li.h1 {
    font-size: 115%;
  }

  button.toc-heading {
    md-icon.rotating-icon {
      height: 18px;
      width: 18px;
      position: relative;
      left: -4px;
      top: 5px;
    }

    &:hover:not(.embedded) {
      color: $accentblue;
    }
  }


  button.toc-more-items {
    color: $mediumgray;
    top: 10px;
    position: relative;

    &:hover {
      color: $accentblue;
    }
  }

  button.toc-more-items::after {
    content: 'expand_less';
  }

  button.toc-more-items.collapsed::after {
    content: 'more_horiz';
  }


  .mat-icon.collapsed {
    @include rotate(0deg);
  }

  .mat-icon:not(.collapsed) {
    @include rotate(90deg);
    // margin: 4px;
  }

  ul.toc-list {
    list-style-type: none;
    margin: 0;
    padding: 0 8px;

    @media (max-width: 800px) {
      width: auto;
    }

  }

  ul.toc-list li {
    font-size: 12px;
    line-height: 16px;
    margin: 6px 0;
    // padding: 0 16px;
    position: relative;
    transition: all 0.3s ease-in-out;

    &.active {
      a {
        color: $blue;
        font-weight: 500;
      }

      &:before {
        content: '';
        border-radius: 50%;
        left: -16px;
        top: 10px;
        background: $blue;
        position: absolute;
        width: 6px;
        height: 6px;
      }
    }

    &.h3 {
      margin-left: 8px;
    }

    &:last-child a:before {
      width: 0;
    }

    a {
      font-size: inherit;
      color: lighten($darkgray, 10);
      display:table-cell;
      overflow: visible;
      font-size: 12px;
      display: table-cell;


      &:hover {
        color: $accentblue;
      }

      &.h2 {
        &:before {
          content: '';
          left: -1px;
          top: 10px;
          background: red;
          position: absolute;
          display: block;
          width: 1px;
          height: calc(100% + 11px);
        }
      }
    }
  }

  // ul.toc-list li.h3 {
  //   margin-left: 15px;
  // }

  // ul.toc-list li.h1:after {
  //   content: "";
  //   display: block;
  //   height: 1px;
  //   width: 40%;
  //   margin: 24px 0px 10px;
  //   background: #DBDBDB;
  //   clear: both;
  // }
}

aio-toc.embedded > div.collapsed li.secondary {
  display: none;
}
